package org.budo.xml;

import java.io.InputStream;

import org.w3c.dom.Document;

/**
 * 对应一个Xml输入流
 * 
 * @author lmw
 */
public class XmlInputStreamObject extends AbstractXmlObject {
    private InputStream inputStream;

    private Document document;

    public XmlInputStreamObject(InputStream inputStream) {
        this.inputStream = inputStream;
        this.document = Xml.build(inputStream);
    }

    public Document getDocument() {
        return document;
    }

    public InputStream getInputStream() {
        return inputStream;
    }

    @Override
    public XmlObject getChildNodeByName(String nodeName) {
        return this.getChildNodeByName(this.getDocument(), nodeName);
    }

    @Override
    public XmlObject[] getChildNodeArrayByName(String nodeName) {
        return this.getChildNodeArrayByName(this.getDocument(), nodeName);
    }
}
